﻿/*****************************************************************************  

 Version: 0.1
 Website: http://www.visuagile.com/
 
 Copyright (c) Yoganand R. All rights reserved.
 For continued development and updates, visit http://yogsbreath.net
 
 ******************************************************************************/

#region Imports

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using VisualAgile.IBLL;
using VisualAgile.IDAL;
using VisualAgile.Model;

#endregion


namespace VisualAgile.BLL
{
    public class ProjectManager : BaseManager<Project>, IProjectManager 
    {
        #region Properties

        public IProjectDao ProjectDao { get; set; }

        #endregion

        protected override IBaseDao<Project> getBaseDAO()
        {
            return ProjectDao;
        }

        /// <summary>
        /// New Project
        /// </summary>
        /// <returns></returns>
        public Project NewProject()
        {
            var project = new Project();

            //Create Time
            project.CreateTime = DateTime.Now;

            return project;
        }

        /// <summary>
        /// Access to Releases
        /// </summary>
        /// <param name="ProjectName">project Id</param>
        /// <returns></returns>
        public Project GetByName(string ProjectName)
        {
            return ProjectDao.FindByName(ProjectName);
        }

        private void Validate(Project project)
        {
            //TODO throw exception on error.
        }
    }
}
